<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
/*******basic*******/
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$postdata['refresh_token']='';
		$postdata['expires_in']=0;
		$postdata['access_token']='';
		$this->plugin_setting('basic',$postdata);
		exi('设置成功');
	}
	$footernav =array(
		array('title'=>'首页','icon'=>'icon-shouye','action'=>'jy_aiagent/index/'),
		array('title'=>'智能体广场','icon'=>'icon-liaotian','action'=>'jy_aiagent/agent/'),
		array('title'=>'个人中心','icon'=>'icon-wo1','action'=>'jy_aiagent/home/'),
	);
	$return['item']=$this->plugin_setting('basic');
	$return['item']['footernav']=$return['item']['footernav']?:$footernav;
	$tip='【智能体广场】：只会展示官方后台添加的智能体，不会展示客户创建的智能体！';
	$htmls=array(
		'type'=>'edit',
		'desc'=>'参数设置',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基本信息',
				'list'=>array(
					array('type'=>'tip','title'=>$tip),
					array('type'=>'string','title'=>'首页顶部标题','name'=>'toptitle','help'=>'默认：你好！我是AI。你的AI达人'),
					array('type'=>'images','title'=>'可选头像','name'=>'logoimgs','help'=>''),
					array('type'=>'string','title'=>'平台标题','name'=>'title','help'=>''),
					array('type'=>'string','title'=>'分享标题','name'=>'share_title'),
					array('type'=>'string','title'=>'分享描述','name'=>'share_desc'),
					array('type'=>'image','title'=>'分享图片','name'=>'share_image','help'=>'建议尺寸：高320px*宽640px'),
				),
			),
			array(
				'title'=>'小智Api',
				'list'=>array(
					array('type'=>'string','title'=>'应用密钥','name'=>'apikey','help'=>'https://xiaozhi.me/developer/products；API中心--Secret Key'),
				),
			),
			/*array(
				'title'=>'小程序广告',
				'list'=>array(
					array('type'=>'string','title'=>'插屏广告','name'=>'wxapp_ad01','help'=>'例如：adunit-513cf0c735a3d48a'),
					array('type'=>'string','title'=>'激励视频广告','name'=>'wxapp_ad02','help'=>'例如：adunit-513cf0c735a3d48a'),
				),
			),*/
			array(
					'title'=>'欢迎幻灯片',
					'list'=>array(
								array('type'=>'switch','title'=>'开启欢迎页面','name'=>'iswelcome','help'=>'开启后，访问首页会先进入欢迎页面！'),
								array('type'=>'array','title'=>'欢迎幻灯片','name'=>'welcomehdps','add_tip'=>'添加一个欢迎幻灯片',
										'list'=>array(
											array('type'=>'string','name'=>'title','title'=>'标题'),
											array('type'=>'image','name'=>'picurl','title'=>'图片'),
											array('type'=>'string','name'=>'url','title'=>'地址'),
										),
										'details'=>array(
											array('type'=>'string','name'=>'title','title'=>'标题'),
											array('type'=>'string','name'=>'desc','title'=>'描述'),
											array('type'=>'image','name'=>'picurl','title'=>'图片','help'=>'推荐尺寸：750*900'),
											array('type'=>'link','name'=>'url','from'=>'action','title'=>'地址'),
										)
								),
					)
			),
			array(
				'title'=>'底部导航',
					'list'=>array(
									array('type'=>'array','name'=>'footernav','add_tip'=>'添加一个底部导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标','help'=>'图标，例如：icon-shouye'),							
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
								),
					)
			),
		)
	);
	$return['htmls']=$htmls;
	exi($return);
}
/*******basic*******/
/*******op*******/
